#include"Gateway.h"

int main(int args, char * argv[])
{
	_CrtDumpMemoryLeaks();

	_CrtMemState s1, s2, s3;

	try 
	{
		_CrtMemCheckpoint( &s1 );

		Gateway gw;

		_CrtMemCheckpoint( &s2 );

		if ( _CrtMemDifference(&s3, &s1, &s2) )
		{
			_CrtMemDumpStatistics(&s3);
			//return -0x1;
		}

		_CrtMemCheckpoint( &s1 );
		
		gw.run();

		_CrtMemCheckpoint( &s2 );

		if ( _CrtMemDifference(&s3, &s1, &s2) )
		{
			_CrtMemDumpStatistics(&s3);
			return -0x1;
		}
		
	}
	catch ( std::exception const& ex)
	{
		std::cerr << ex.what() << std::endl;
		std::cin.get();
		return 0x1;
	}
	
	_CrtDumpMemoryLeaks();

	return 0x0;
}
